<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<SubsidiosBussinessLogic.Models.Bloque>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Listar
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
  
<script type="text/javascript">
    jQuery(document).ready(function(){ 
      jQuery("#list").jqGrid({
        url:'/Bloque/GridData/',
        datatype: 'json',
        mtype: 'GET',
        colNames:['BloqueId','Descripcion'],
        colModel :[
          {name:'BloqueId', index:'BloqueId', width:120, align:'left',editrules: { edithidden: true,  editable: false},searchoptions:{sopt:['eq','cn']} },
          {name:'Descripcion', index:'Descripcion', width:700, align:'left', editable: true, edittype: 'text', editoptions: { size: 20, maxlength: 30},searchoptions:{sopt:['eq','cn']} },
         ],
        
        pager: jQuery('#pager'),
        rowNum:10,
        rowList:[5,10,20,50],
        sortname: 'BloqueId',
        sortorder: "asc",
        viewrecords: true,
        jsonReader: { repeatitems : true, id: "0" },
        imgpath: '/Scripts/themes/redmond/images',
        height : '100%',
        caption: 'Bloques',
        //editurl:'/Bloque/GridataSave/', 
       
        
      }).navGrid('#pager', {edit:true, add:true,search:true}, //options 
        {
           
            height:150,
            reloadAfterSubmit:false,
            closeOnEscape:true, 
            url:'/Bloque/GridataSave/',
            resize:false,
            checkOnSubmit:true,
            checkOnUpdate:true,
            closeAfterEdit:true,
            savekey:[true,13],
            modal:true                 

        }, // edit options 
        {
            
            reloadAfterSubmit:true,
            closeOnEscape:true, 
            url:'/Bloque/GridataAdd/',
            resize:false,
            clearAfterAdd:true,
            reloadAfterSubmit:true,
            savekey:[true,13],
            modal:true          
        }, // add options 
        {
            width:300,  
            reloadAfterSubmit:true,
            closeOnEscape:true, 
            url:'/Bloque/GridataDelete/',
            resize:false,
            checkOnSubmit:true,
            modal:true
                        
        }, // del options 
            
        { 
            
            
          
        }, // search options 
        {
        }
        );  
    }); 
</script>


<h2>Lsitado de bloques</h2>
<table id="list" class="scroll" cellpadding="0" cellspacing="0" Width="100%" style ="text-align:center"  >

</table>
<div id="pager" class="scroll" style="text-align:center;"></div>

</asp:Content>

